package com.sky.mapper.admin;

import com.sky.dto.OrdersPageQueryDTO;
import com.sky.vo.OrderStatisticsVO;
import com.sky.vo.OrderVO;
import org.apache.ibatis.annotations.Mapper;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

@Mapper
public interface AdminOrderMapper {
    Page<OrderVO> conditionSearch(OrdersPageQueryDTO dto);
  //   @RunUserTime
    Integer statistics(int status);

    /**
     *统计所有订单状态的
     * @return
     */
    @Select("select status,count(1) as a from orders group by status")
    List<Map<String,Object>> countableStatus();

  /**
   * 使用行列转换进行查询
   */
    OrderStatisticsVO statisticsAllStatusOrderCount2();

  OrderVO adminOrderDetails(Long id);
}
